//
//  LENoDataView.m
//  LoveExpressBusiness
//
//  Created by 刘甲奇 on 2017/5/25.
//  Copyright © 2017年 DFH. All rights reserved.
//

#import "ZDNoDataView.h"

@interface ZDNoDataView()

/**
 提示标签
 */
@property(nonatomic,strong)UILabel *tipLabel;
/**
 <#Description#>
 */
@property(nonatomic,strong)UIImageView *icon;
/**
 <#Description#>
 */
@property(nonatomic,strong)UILabel *noticeLabel;
@end

@implementation ZDNoDataView

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self setupUI];
    }
    return self;
}

- (void)setupUI
{
    UIImageView *icon = [[UIImageView alloc] init];
    [self addSubview:icon];
    icon.image = [UIImage imageNamed:@"noMore_data"];
    icon.size = CGSizeMake(64, 64);
    self.icon = icon;
    
    //提示内容
    UILabel *tipLabel = [UILabel new];
    [self addSubview:tipLabel];
    self.tipLabel = tipLabel;
    tipLabel.textAlignment = NSTextAlignmentCenter;
    tipLabel.font = [UIFont systemFontOfSize:13];
    tipLabel.textColor = [UIColor lightGrayColor];
    
    //
    UILabel *noticeLabel = [UILabel new];
    [self addSubview:noticeLabel];
    noticeLabel.text = @"下拉刷新试试";
    noticeLabel.textAlignment = NSTextAlignmentCenter;
    noticeLabel.font = [UIFont systemFontOfSize:13];
    noticeLabel.textColor = [UIColor lightGrayColor];
    self.noticeLabel = noticeLabel;
    
}
- (void)layoutSubviews
{
    [super layoutSubviews];
    self.icon.center = CGPointMake(self.bounds.size.width/2.0, self.bounds.size.height/2.0 -74);
    self.tipLabel.frame = CGRectMake(10, self.icon.bottom +8, self.width -20, 25);
    self.noticeLabel.frame = CGRectMake(10, self.tipLabel.bottom + 8, self.width -20, 25);

}

- (void)setNoDataText:(NSString *)tipText
{
    self.tipLabel.text = tipText;
}

@end
